package org.icop.model;

import java.util.Set;

import org.jbpt.hypergraph.abs.IVertex;

/**
 * Class that represents a correspondences between two vertices that
 * is assigned a confidence value. 
 * 
 * NOTE: we do not consider the confidence value as part of the identity 
 * of a correspondence, i.e., <code>equals</code> and <code>hashCode</code> 
 * methods of a valued correspondences are the same as for a correspondence.
 * 
 * @author matthias.weidlich
 *
 * @param <V> template for the type of vertices considered
 */
public class ValuedCorrespondence<V extends IVertex> extends Correspondence<V> {
	
	private double confidenceValue = 0;

	public ValuedCorrespondence(V v1, V v2, double c) {
		super(v1,v2);
		this.confidenceValue = c;
	}

	public ValuedCorrespondence(Set<V> v1, Set<V> v2, double c) {
		super(v1,v2);
		this.confidenceValue = c;
	}

	public double getConfidenceValue() {
		return confidenceValue;
	}

	public void setConfidenceValue(double confidenceValue) {
		this.confidenceValue = confidenceValue;
	}
	
	@Override
	public String toString() {
		return this.getV1s().toString() +  " - " +  this.getV2s().toString() + " (" + this.confidenceValue + ")";
	}

}
